home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Applications / Demos_Demo folder / Demos_Info folder / Demos™ Demonstration / More Examples / Sorting an Index < prev    next >
Text File  |  1994-02-16  |  2KB  |  78 lines

  1. { From user A Lumens, Project Sorting at Wed, Feb 16, 1994 10:53 AM}
  2.  
  3.  
  4. { System Variables with non-default values: }
  5. Verbosity := 18
  6. Typechecking := 1
  7. Checking := 1
  8. Saveoptions := 2
  9. Savevalues := 0
  10.  
  11.  
  12. { Non-default Time SysVar value: }
  13. Time := [0,1,2]
  14.  
  15. Attribute Reference
  16.  
  17. Project Sorting
  18. Title: Sorting Example
  19. Description: Example that shows how to sort an Index according to rank values (i.e., the ordering) and apply the sorted index to an array so that the array is also sorted.
  20. Author: A Lumens
  21. Date: Wed, Feb 9, 1994 10:40 AM
  22. Saveauthor: A Lumens
  23. Savedate: Wed, Feb 16, 1994 10:52 AM
  24. Defaultsize: 48,20
  25. Diagstate: 1,40,50,449,243,3
  26. Windstate: 1,204,252
  27. Fileinfo: 0,-5,2,Project Sorting,Sorting an Index
  28. Getresource Pagesetup,1
  29.  
  30. Index Measures
  31. Title: Measures
  32. Description: A set of measures not in any particular order
  33. Definition: ['A','B','C']
  34. Location: 64,40
  35. Nodesize: 48,20
  36. Valuestate: 1,136,146,244,151,0,MIDM
  37.  
  38. Chance R
  39. Title: R: ranks
  40. Description: The ranks, or order from minimum to maximum, of array A.~
  41. ~
  42. To obtain an ordering from maximum to minimum, use:~
  43.     Size(Measures) + 1 - Rank( A, Measures )
  44. Definition: Rank(A, Measures)
  45. Location: 192,40
  46. Nodesize: 48,20
  47. Defnstate: 1,460,528,416,303,0,MIDM
  48. Valuestate: 1,120,130,247,155,0,MIDM
  49.  
  50. Chance A
  51. Title: A
  52. Description: An array indexed by Measures representing some intermediate result or outcome.
  53. Definition: Table(Measures)(
  54. 5M,20M,1M)
  55. Location: 64,128
  56. Nodesize: 48,20
  57. Defnstate: 1,91,421,416,303,0,MIDM
  58. Valuestate: 1,14,230,298,193,1,MIDM
  59.  
  60. Index Sortedmeas
  61. Title: Sorted Measures
  62. Description: Measures sorted by the values in array A
  63. Definition: Sortindex(R, Measures)
  64. Location: 320,40
  65. Nodesize: 48,20
  66. Valuestate: 1,329,257,238,163,0,MIDM
  67.  
  68. Chance Sorteda
  69. Title: Sorted A
  70. Description: Array A rearranged using sorted measures.
  71. Definition: A[Measures=Sortedmeas]
  72. Location: 320,128
  73. Nodesize: 48,20
  74. Valuestate: 1,317,230,298,193,1,MIDM
  75.  
  76. Close Sorting
  77.  
  78.